package com.msda.utils;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;




@NoArgsConstructor
@AllArgsConstructor
@Data
public class Result<T> {
    private int code;
    private String message;
    private T data;

    public static <T> Result<T> success(T data) {
        return new Result<>(1, "Success", data);
    }

    public static <T> Result<T> success() {
        return new Result<>(1, "Success", null);
    }

    public static <T> Result<T> error(String message) {
        return new Result<>(0, message, null);
    }
}

